package com.itao.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Description
 * @Author sjt
 * @CreateTime 2023/03/13 17:55
 */

@Configuration
//@LoadBalancerClients(defaultConfiguration = LoadBalanceConfig.class)
//@LoadBalancerClient(name ="nacos-server", configuration = LoadBalanceConfig.class)
public class RestTemplateConfig {

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
